package com.example.child_protection.service.base;

import com.example.child_protection.dto.base.BaseRequestDTO;
import com.example.child_protection.dto.base.BaseResponseDTO;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public abstract class ServiceExecutor<REQUEST extends BaseRequestDTO, RESPONSE extends BaseResponseDTO>{
    /**
     * 业务处理.
     */
    protected RESPONSE process(HttpServletRequest request, HttpServletResponse response, REQUEST requestDTO ) throws Exception {
        return null;
    };

    protected RESPONSE process( REQUEST requestDTO ) throws Exception {
        return null;
    };

    /**
     * 前置处理, 钩子方法.
     */
    protected void beforeProcess( HttpServletRequest request, HttpServletResponse response, REQUEST requestDTO ) throws Exception {
    }

    protected void beforeProcess( REQUEST requestDTO ) throws Exception {
    }

}
